<template>
    <div>
        <slot>默认值:文本，HTML，组件</slot>
    </div>
</template>
<script lang="ts" setup>
import { onMounted,onBeforeUnmount,onUnmounted } from "vue";
// let timer:ReturnType<typeof setInterval>
onMounted(()=>{
    // timer=setInterval(()=>{
    //     console.log('定时器无限运行中');
    // },1000)
})
onUnmounted(()=>{
    console.log('onUnmounted:在组件实例被卸载之后调用');
})
onBeforeUnmount(()=>{
    console.log('onBeforeUnmount:在组件实例被卸载之前调用');
    // clearInterval(timer)
})
</script>